﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using AndrysNet.HiUpdateTools_Addin.Core;

namespace HiUpdateTools.Client.Wpf
{
    /// <summary>
    /// Interaction logic for ErrorWindow.xaml
    /// </summary>
    public partial class ErrorWindow : Window
    {
        public Exception Error { get; set; }

        public ErrorWindow()
        {
            InitializeComponent();
        }

        private void btOk_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void btReportBug_Click(object sender, RoutedEventArgs e)
        {
            new MAPI((new System.Windows.Interop.WindowInteropHelper(this)).Handle, null, "HiUpdateTools - Update error report", meErrorDescription.Text + "\r\n" + meErrorStackTrack.Text, "Josef Andrys", "josef.andrys@gmail.com");

        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            meErrorDescription.Text = Error.Message;
            meErrorStackTrack.Text = Error.StackTrace;
        }
    }
}
